package com.chuangjiangx.member.manager.web.web.score.request;

import com.chuangjiangx.commons.request.PageRequest;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class ScoreGiftCountByScoreDetailRequest extends PageRequest {

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;
    /**
     * 门店id
     */
    private Long storeId;

    /**
     * 终端类型
     */
    private Byte terminalType;

    /**
     * 会员名称或手机号
     */
    private String nameOrMobile;

    /**
     * 商户id
     */
    private Long merchantId;

    /**
     * 商户用户id
     */
    private Long merchantUserId;

    /**
     * 兑换id
     */
    private Long scoreGiftId;

    public void setNameOrMobile(String nameOrMobile) {
        if (nameOrMobile != null) {
            this.nameOrMobile = "%" + nameOrMobile + "%";
        }
    }
}
